public class FindSome {
    public static void main(String[] args) {
        int[] a = {3, 2, 8, 6, 5, 7, 4, 6};
        for (int i = 0; i < a.length; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i] > a[j]) {
                    int temp = a[i];
                    a[i] = a[j];
                    a[j] = temp;
                }
            }
        }
        int some = a[0];
        for (int i = 1; i < a.length; i++) {
            if (a[i] == some) {
                System.out.println(some);
                break;
            } else {
                some = a[i];
            }
        }
    }
}
